(function()
{
	var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
	this.Class = function(){};
	
	Class.extend = function(prop) 
	{
		var _super = this.prototype;
		
		initializing = true;
		var prototype = new this();
		initializing = false;
		
		for (var name in prop) 
		{
			prototype[name] = typeof prop[name] == "function" && typeof _super[name] == "function" && fnTest.test(prop[name]) ?
			(function(name, fn)
			{
				return function() 
				{
					var tmp = this._super;
					this._super = _super[name];
					var ret = fn.apply(this, arguments);        
					this._super = tmp;
					return ret;
				};
			})(name, prop[name]) :
			prop[name];
		}
		
		function Class() 
		{
			if ( !initializing && this.init )
				this.init.apply(this, arguments);
		}
		
		Class.prototype = prototype;
		Class.prototype.constructor = Class;
		Class.extend = arguments.callee;
		
		if (__currLibDir != undefined)
			Class.prototype.libDir = __currLibDir;
		
		return Class;
	};
})();

//====================== Pasta Function ======================

(function(){

	this.uses = function(fileName)
	{
		// blank for web version
	};
	
	this.isNumber = function(n) 
	{
		return !isNaN(parseFloat(n)) && isFinite(n);
	};
	
	this.getFlashMovie = function(movieName) 
	{
		var isIE = navigator.appName.indexOf("Microsoft") != -1;
		return (isIE) ? window[movieName] : document[movieName];  
	};
	
	this.getDateString = function(dt, includeHour)
	{
		if (dt == null)
			dt = new Date();
		
		var year = dt.getFullYear();
		var month = dt.getMonth() + 1;
		var date = dt.getDate();
		
		var result = year + "-" + (month < 10 ? ("0" + month) : ("" + month)) + "-" + (date < 10 ? ("0" + date) : ("" + date));
		
		if (includeHour)
		{
			var hh = dt.getHours();
			var mn = dt.getMinutes();
			
			result += " " + (hh < 10 ? ("0" + hh) : ("" + hh)) + ":" + (mn < 10 ? ("0" + mn) : ("" + mn));
		}
		
		return result;
	};
	
	this.dateToShortStr = function(data)
	{
		var mnt = "";
		
		switch (data.getMonth())
		{
			case 0 :
						mnt = "Jan";
						break;
			case 1 :
						mnt = "Feb";
						break;
			case 2 :
						mnt = "Mar";
						break;
			case 3 :
						mnt = "Apr";
						break;
			case 4 :
						mnt = "Mei";
						break;
			case 5 :
						mnt = "Jun";
						break;
			case 6 :
						mnt = "Jul";
						break;
			case 7 :
						mnt = "Agu";
						break;
			case 8 :
						mnt = "Sep";
						break;
			case 9 :
						mnt = "Okt";
						break;
			case 10 :
						mnt = "Nov";
						break;
			case 11 :
						mnt = "Des";
						break;
		}
		
		return (data.getDate() + " " + mnt + " " + data.getFullYear());
	};

	this.dateStrToShortStr = function(data, includeTime)
	{
		if (data != "0000-00-00 00:00:00")
		{
			//0000-00-00 00:00:00
			//0123456789012345678
			
			var mnt = "";
			
			var yy = data.substr(0, 4);
			var mm = data.substr(5, 2);
			var dd = data.substr(8, 2);
			
			var hh = data.substr(11, 2);
			var mn = data.substr(14, 2);
			var ss = data.substr(17, 2);
			
			switch (mm)
			{
				case "01" :
							mnt = "Jan";
							break;
				case "02" :
							mnt = "Feb";
							break;
				case "03" :
							mnt = "Mar";
							break;
				case "04" :
							mnt = "Apr";
							break;
				case "05" :
							mnt = "Mei";
							break;
				case "06" :
							mnt = "Jun";
							break;
				case "07" :
							mnt = "Jul";
							break;
				case "08" :
							mnt = "Agu";
							break;
				case "09" :
							mnt = "Sep";
							break;
				case "10" :
							mnt = "Okt";
							break;
				case "11" :
							mnt = "Nov";
							break;
				case "12" :
							mnt = "Des";
							break;
			}
			
			if (includeTime)
				return parseInt(dd) + " " + mnt + " " + yy + " " + hh + ":" + mn + ":" + ss;
			else
				return parseInt(dd) + " " + mnt + " " + yy;
		}
		else
			return "";
	};
})();